package com.baturu.vin.benz.utils;

import com.baturu.vin.benz.consts.BenzLandEnum;

import java.util.Objects;

/**
 * ThreadUtil
 *
 * @author majianming
 * @date 2019-06-18 14:39
 */
public class ThreadUtil {
    public final static ThreadLocal<BenzLandEnum> landEnumThreadLocal = new ThreadLocal<>();

    public static BenzLandEnum getBenzLandEnum() {
        BenzLandEnum benzLandEnum = landEnumThreadLocal.get();
        if (Objects.isNull(benzLandEnum)) {
            return BenzLandEnum.getDefault();
        }
        return benzLandEnum;
    }

    public static void setLandEnum(BenzLandEnum benzLandEnum) {
        landEnumThreadLocal.set(benzLandEnum);
    }

}
